import 'package:flutter/material.dart';
import 'package:p_location/common/constant/color_list.dart';

class VerticalInfoItem extends StatelessWidget {
  final String leftValue;
  final String rightValue;

  VerticalInfoItem(this.leftValue, this.rightValue);

  final BoxDecoration _decoration = BoxDecoration(
      color: Colors.white,
      border: Border(bottom: BorderSide(color: Colors.grey, width: 0.4)));

  @override
  Widget build(BuildContext context) {
    return Container(
      decoration: _decoration,
//      color: Colors.white,
      padding: EdgeInsets.only(left: 20, right: 10, top: 10, bottom: 0),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: <Widget>[
          Text(
            leftValue,
            style: TextStyle(fontSize: 12, color: ColorList.BLACK_65),
          ),
          Container(
            margin: EdgeInsets.only(top: 10, bottom: 10),
            child: Text(rightValue,
                style: _textStyle(rightValue)),
          )
        ],
      ),
    );
  }
}


TextStyle _textStyle(String rightValue){
    if(rightValue == "报警中") return TextStyle(fontSize: 14, color: ColorList.RED_70);
    return TextStyle(fontSize: 14, color: ColorList.BLACK_65);
}